package dokonala_cisla;

public class dokonala
{
	private static int num = 2;

	public static void main(String[] args)
	{
		while (true)
		{
			if (isPerfect(num))
				System.out.println(num);
			num++;
		}

	}

	public static boolean isPerfect(int number)
	{
		if (number % 2 == 1)
			return false;

		int result = 1;
		for (int i = 2; i <= number / 2; i++)
		{
			if (number % i == 0)
				result += i;
		}
		return result == number;
	}

}
